# from flask_learn.ORM增删改查 import models
import models
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine

engine = create_engine("mysql+pymysql://root:qaz3357375@127.0.0.1:3306/test?charset=utf8", max_overflow=5)
Session = sessionmaker(bind=engine)
session = Session()

# 单条增加
# obj = models.Classes(name='全栈1期')
# session.add(obj)

# 多条增加
# objs = [
#     models.Classes(name='全栈2期'),
#     models.Classes(name='全栈3期'),
#     models.Classes(name='全栈4期')
# ]
# session.add_all(objs)


session.commit()
session.close()
